import React from 'react'
import { ProductCard, Tag,  } from 'react-vant';
import { PROPSTYPE } from '../Type/Store.d';
import { useNavigate } from 'react-router-dom';

interface SUMCHILDRENTYPE {
    item:PROPSTYPE,
    fo?:number,
}
function SumChildren(props:SUMCHILDRENTYPE) {
    let { item ,fo}  = props;
    const Navigate = useNavigate();

    return (
        <div className='SumChildren'>
            <ProductCard 
                tag="精品"
                desc={item.con}
                title={item.txt}
                tags={ <>
                    <Tag plain type="warning" style={{ marginRight: 5 }}> {item.sex} </Tag>
                    <Tag plain type="danger"> {item.type} </Tag>
                </> }
                thumb={item.src}
                footer={ fo ? <>喜爱度 : {item.love} </> : '' }
                onClick={()=>Navigate('/Detail/'+item.id,{state:item})}
            />
        </div>
    )
}

export default SumChildren